home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #9 / Amiga Plus CD - 2004 - No. 09.iso / amigaplus / tools / dev_libs / feelin040718 / demos / test2.e < prev    next >
Text File  |  2004-08-03  |  1KB  |  49 lines

  1. OPT PREPROCESS
  2.  
  3. MODULE 'feelin','libraries/feelin',
  4.        'dos/dos'
  5.  
  6. CONST NUM = 200
  7.  
  8. PROC main()
  9.    DEF g:FObject,i,
  10.        ds1:datestamp,ds2:datestamp,o
  11.  
  12.    IF feelinbase := OpenLibrary('feelin.library',FV_VERSION)
  13.       IF g := F_NewObjA(FC_Group,NIL)
  14.          WriteF('This test will first create an instance of FC_Group.\nThen \d instances of FC_Area will be created and added to the FC_Group object as children.\n\n',NUM)
  15.  
  16.          WriteF('F_NewObjA()    ')
  17.  
  18.          Forbid() ; DateStamp(ds1)
  19.  
  20.          FOR i := 0 TO NUM - 1
  21.             o := F_NewObjA(FC_Area,NIL); F_DoA(g,FM_AddMember,[o,FV_AddMember_Tail])
  22.          ENDFOR
  23.  
  24.          DateStamp(ds2) ; Permit() ; saytime(ds1,ds2)
  25.  
  26.          F_DoA(g,FM_AddMember,[o,FV_AddMember_Tail])
  27.  
  28.          WriteF('F_DisposeObj() ')
  29.  
  30.          Forbid() ; DateStamp(ds1)
  31.  
  32.          F_DisposeObj(g)
  33.  
  34.          DateStamp(ds2) ; Permit() ; saytime(ds1,ds2)
  35.       ENDIF
  36.  
  37.       CloseLibrary(feelinbase)
  38.    ENDIF
  39. ENDPROC
  40.  
  41. PROC saytime(ds1:PTR TO datestamp,ds2:PTR TO datestamp)
  42.    DEF ticks
  43.  
  44.    ticks := ((((ds2.minute - ds1.minute) * 60)) * TICKS_PER_SECOND) + (ds2.tick - ds1.tick)
  45.  
  46.    WriteF('%12.ld per second (%4.ld ticks)\n',NUM * TICKS_PER_SECOND / ticks,ticks)
  47. ENDPROC
  48.  
  49.